package cc.rengu.oltp.service.common.enums;

/**
 * 限额类型枚举
 * Created by 王成 on 2020/2/6.
 */
public enum LimitTypeEnum {
    MCHNT_LEVEL("01", "商户等级"),
    MCHNT_SCOPE("02", "商户组别"),
    MCC("03", "MCC"),
    MCHNT_NO("11", "商户"),
    MCHNT_TERM("12", "商户终端"),
    MCHNT_TRANS("13", "商户交易"),
    MCHNT_REFUND("14", "商户退货"),
    PAY_POS("16", "代付POS"),
    CHANNEL("20", "支付通道"),
    CHANNEL_TRANS("21", "支付通道交易"),
    PAY_ACCT("30", "支付账号"),
    B2C_STATIC("40", "主扫静态码"),
    C2B_QR("42", "二维码限额"),
    CASHIER("43", "收银台用户限额");

    private String limitType;
    private String limitDesc;

    LimitTypeEnum(String limitType, String limitDesc) {
        this.limitType = limitType;
        this.limitDesc = limitDesc;
    }

    public String getLimitType() {
        return limitType;
    }

    public void setLimitType(String limitType) {
        this.limitType = limitType;
    }

    public String getLimitDesc() {
        return limitDesc;
    }

    public void setLimitDesc(String limitDesc) {
        this.limitDesc = limitDesc;
    }

    /**
     * 根据限额类型获取枚举类型描述
     *
     * @param limitType 限额类型
     * @return 限额类型描述
     */
    public static String getLimitTypeDesc(String limitType) {
        for (LimitTypeEnum limitTypeEnum : LimitTypeEnum.values()) {
            if (limitTypeEnum.getLimitType().equals(limitType)) {
                return limitTypeEnum.getLimitDesc();
            }
        }
        return null;
    }
}
